<template>
    <div>
        <!-- <h3>当前最新的count值为:{{ count }}</h3> -->
        <h3>{{ showNum }}</h3>
        <button @click="subHandel">-1</button>
        <button @click="subN(3)">-N</button>
        <button @click="subAsync">-1 async</button>
        <button @click="subNAsync(3)">-N async</button>
    </div>
</template>

<script>
import { mapMutations, mapState, mapActions, mapGetters } from 'vuex'
export default {
  data () {
    return {

    }
  },

  mounted () {

  },

  methods: {
    ...mapMutations(['sub', 'subN']),
    ...mapActions(['subAsync', 'subNAsync']),

    subHandel () {
      this.sub()
    }
  },
  computed: {
    ...mapState(['count']),
    ...mapGetters(['showNum'])
  }
}
</script>

<style scoped>

</style>
